const Obj = myGetUrlValObj();
    let page = 1;
    let line = 8;
    
    setPage();

function setPage(){
    const p = new Promise(function(f,r){
    $.ajax({
        url:'../server/goods_list.php',
        type:'get',
        data:{cat_one_id:Obj.cat_one_id,page:page,line:line},
        dataType:'json',
        success:f,
        error:r,
    })
    })
    p.then(function(res){
    console.log(res);

    let str = '';
    res.data.forEach(item => {
        str += `
        <li class="list-item">
            <div class="panel panel-primary">
            <div class="panel-body">
                <ol class="breadcrumb">
                <li><a href="#">${item.cat_one_id}</a></li>
                <li><a href="#">${item.cat_two_id}</a></li>
                <li class="active">${item.cat_three_id}</li>
                </ol>
            </div>
            <div class="panel-footer">
                <div class="row">
                <div class="">
                    <div class="thumbnail">
                    <img src="${item.goods_big_logo}" alt="...">
                    <div class="caption">
                        <h3>${item.goods_name}</h3>
                        <p>
                        <i class="glyphicon glyphicon-yen"></i>
                        <span>${item.goods_price}</span>
                        </p>
                        <p>
                        <a href="javascript:;" class="btn btn-primary" role="button">查找相似商品</a>
                        <a href="./detail.html?goods_id=${item.goods_id}" class="btn btn-danger" role="button">查看商品详情</a>
                        </p>
                    </div>
                    </div>
                </div>
                </div>
            </div>
            </div>
        </li>
        
        `;
    })
    $('.container>ul').html(str);
    console.log(0);
    $('.box').pagination({
        pageCount:res.sumPage,
        totalData:res.row,
        current:res.page,
        showData:res.line,
        prevCls: 'prev',
        nextCls: 'next',
        prevContent:'上一页',
        nextContent:'下一页',
        activeCls:'active',
        mode:'fixed',
        count:4,
        coping:true,
        homePage:'首页',
        endPage:'末页',
        isHide:true,
        jump : true,
        jumpIpCls:'jump-ipt',
        jumpBtnCls:'jump-btn',
        jumpBtn:'跳转',
        callback:function(val){
        page = val.getCurrent();
        setPage();
        }
    })
    })

}